package com.zephyr.vchcenter.util;

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;

public class ProperitesHelper {
	public static PropertiesConfiguration getConfig() {

		PropertiesConfiguration config;
		try {
			config = new PropertiesConfiguration("vchzms-hiaward-config.properties");
			// 配置文件更新后信息自动刷新
			config.setReloadingStrategy(new FileChangedReloadingStrategy());
		} catch (ConfigurationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			throw new RuntimeException("读取配置文件失败!");
		}

		return config;
	}

	public static String getStampServerUrl() {
		return getConfig().getString("cmbc.stampserver.url");
	}
	
	public static String getImageServerUrl() {
		return getConfig().getString("cmbc.imageserver.url");
	}
	
	public static String getImageServletUrl() {
		return getConfig().getString("cmbc.imageservlet.url");
	}
}
